package com.spring.cloud.controller;

import com.spring.cloud.service.GreetingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author duan
 * @version 1.0
 * @date 2023/6/12 19:33
 */
@RestController
public class GreetingController {

    @Autowired
    private GreetingService greetingService;

    @GetMapping("/get-greeting/{username}")
    public String getGreeting(@PathVariable("username") String username) {
        return greetingService.getGreeting(username);
    }
}
